import { configureStore } from "@reduxjs/toolkit";
import rootReducer from "./reducers";
import { useSelector as useReduxSelector, TypedUseSelectorHook } from "react-redux";

const store = configureStore({
    reducer: rootReducer
    // 其他配置选项
});

export type RootState = ReturnType<typeof store.getState>;
export type AppDispatch = typeof store.dispatch;
// useSelector 类型封装
export const useSelector: TypedUseSelectorHook<RootState> = useReduxSelector;

export default store;
